#include <iostream>
#include <vector>

using namespace std;

int findIndex(int num, vector<int>& sortScore) {
    for(int i = 0; i < sortScore.size(); i++){
        if(num == sortScore[i]){
            return sortScore.size() - i;
        }
    }
    return -1;
}

vector<string> findRelativeRanks(vector<int>& score) {
    vector<int> sortScore = score; vector<string> ret;
    sort(sortScore.begin(), sortScore.end());
    for(int i = 0; i < score.size(); i++){
        int index = findIndex(score[i], sortScore);
        if(index == 1){
            ret.push_back("Gold Medal");
        }else if(index == 2){
            ret.push_back("Silver Medal");
        }else if(index == 3){
            ret.push_back("Bronze Medal");
        }else{
            ret.push_back(to_string(index));
        }
    }
    return ret;
}

int main(){
    vector<int> score = {10,3,8,9,4};
    vector<string> ret = findRelativeRanks(score);
    return 0;
}